﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        int ReservationID;
        ReservationManager reservationManager = new ReservationManager((debioscoopEntities)Session["db"]);
        if (!String.IsNullOrEmpty(Request.Form["ReservationID"]))
        {
            ReservationID = int.Parse(Request.Form["ReservationID"]);
            bestelling foundReservation = reservationManager.getReservationActive(ReservationID);

            //When the order is found
            if (foundReservation != null)
            {
                Session["Bestelling"] = foundReservation;
                Response.Redirect("~/touchscreen/buyticket/PaymentOptions.aspx");
            }
            //When the order is not found
            else
            {
                lblNotification.Text = Master.tl.getTranslation("theOrdernumber") + " " + ReservationID.ToString() + " " + Master.tl.getTranslation("isNotInOurSystem");
            }
        }

        Master.tl.pageTranslator(collectReservation.Controls);
    }
}